﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cloud.Update.Core.Models
{
    public class ClientParameter
    {
        /// <summary>
        /// 1:MainApp 2:UpdateApp
        /// </summary>
        public int AppType { get; set; }

        /// <summary>
        /// 启动程序名称(可以加上相对路径)
        /// </summary>
        public string AppName { get; set; }

        /// <summary>
        /// 下载的内容放到哪里
        /// </summary>
        public string DownLoadPath { get; set; }

        /// <summary>
        /// 解压的内容放到哪里
        /// </summary>
        public string UnZipPath { get; set; }
        /// <summary>
        /// 备份地址
        /// </summary>
        public string BackUpPath { get; set; }
        /// <summary>
        /// 客户端版本当前
        /// </summary>
        public string ClientVersion { get; set; }
        /// <summary>
        /// 日志访问地址
        /// </summary>
        public string UpdateLogUrl { get; set; }
        /// <summary>
        /// 是否修改目标版本(通过修改version.ini的方式统一控制版本)
        /// </summary>
        public bool IsUpdateVersion { get; set; }
        /// <summary>
        /// 是否是还原版本
        /// </summary>
        public bool IsRestore { get; set; }
        /// <summary>
        /// 多版本更新
        /// </summary>
        public List<UpdateVersion> UpdateVersions { get; set; }
    }
    public class UpdateVersion
    {
        //public UpdateVersion(string version, string url, string name, bool isUpdate = true)
        //{
        //    Version = version;
        //    Url = url;
        //    Name = name;
        //    IsUpdate = isUpdate;
        //}
        public UpdateVersion(string version, string url, bool isUpdate = true)
        {
            Version = version;
            Url = url;
            IsUpdate = isUpdate;
        }
        /// <summary>
        /// 更新的包名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 更新的版本
        /// </summary>
        public string Version { get; set; }

        /// <summary>
        /// 包地址
        /// </summary>
        public string Url { get; set; }
        /// <summary>
        /// 是否更新
        /// </summary>
        public bool IsUpdate { get; set; }
    }
}
